package cn.wudl.tags.models.rule

import cn.wudl.tags.models.BasicModel
import cn.wudl.tags.tools.TagTools
import org.apache.spark.sql.{DataFrame, SparkSession}

/**
 * 标签模型开发：用户政治面貌标签
 */
class PoliticalModel extends BasicModel{
  /*
  328	政治面貌
    329	群众		    1
    330	党员		    2
    331	无党派人士	3
   */
  override def doTag(businessDF: DataFrame, tagDF: DataFrame): DataFrame = {
    val session: SparkSession = businessDF.sparkSession
    import session.implicits._
    import org.apache.spark.sql.functions._

    tagDF.printSchema()
    tagDF.show(10, truncate = false)

    val modelDF = TagTools.ruleMatchTag(businessDF, "politicalface", tagDF)
    modelDF

  }

}


object PoliticalModel{
  def main(args: Array[String]): Unit = {
    val tagModel = new PoliticalModel()
    tagModel.executeModel(328L)
  }
}